$(function () {
    $(".pay").on("click", function () {
        const count = parseInt($("#totalCount").text());
        const price = parseFloat($("#totalPrice").text().replace("￥", ""));
        if (count > 0) {
            alert(`您购买了 ${count} 件商品，共需支付 ${price}￥。`);
        } else {
            alert("请至少选择一件商品进行结算！");
        }
    });
})